//
//  HelpinfoService.m
//  YYZB
//
//  Created by BY_R on 16/4/8.
//
//

#import "HelpinfoService.h"

@implementation HelpinfoService
//获取个人资料
-(void)getHelperInfo:(NSString *)helperID completionHanlder:(void (^)(NSArray *, NSError *))completionHanlder{
    NSString *URL = @"Helper/GetHelperInfo";
    NSDictionary *params = @{
                             @"HelperId": helperID,
                             
                             };
    NSString *URLString = [self formattedURLString:params method:URL sessionNeeded:YES];
    [self sendHTTPGetRequest:URLString completionHandler:^(id result, NSError *error) {
        if (error != nil) {
            completionHanlder(nil, error);
        } else {
            NSError *err;
            NSArray *items = [self unboxedValue:result error:&err];
            completionHanlder(items, err);
        }
    }];
}
//update个人资料
- (void)updateHelperInfo:(NSString *)name :(NSString*)gender :(NSString*)description :(NSString*)birthday
       completionHanlder:(void (^)(NSArray *items, NSError *error))completionHanlder{
    NSString *URL = @"Helper/GetHelperInfo";
    NSDictionary *params = @{
                             @"HelperId": name,
                             @"Gender":gender,
                             @"PerDescription":description,
                             @"BirthDay":birthday
                             
                             };
    NSString *URLString = [self formattedURLString:params method:URL sessionNeeded:YES];
    [self sendHTTPGetRequest:URLString completionHandler:^(id result, NSError *error) {
        if (error != nil) {
            completionHanlder(nil, error);
        } else {
            NSError *err;
            NSArray *items = [self unboxedValue:result error:&err];
            completionHanlder(items, err);
        }
    }];
}


//fmy---- 获取周几 -----
- (void)getCurrentDayCompletionHanlder:(void (^)(NSString *items, NSError *error))completionHanlder{
    NSString *URL = @"Common/GetCurrentDay";
    NSDictionary *params = @{
                            
                             
                             };
    NSString *URLString = [self formattedURLString:params method:URL sessionNeeded:YES];
    [self sendHTTPGetRequest:URLString completionHandler:^(id result, NSError *error) {
        if (error != nil) {
            completionHanlder(nil, error);
        } else {
            NSError *err;
            NSString *items = [self unboxedValue:result error:&err];
            completionHanlder(items, err);
        }
    }];
}

@end
